package net.huashitong.ssydt.security.utils;


import net.huashitong.ssydt.constants.SsydtConsts;
import net.huashitong.ssydt.exceptions.ParamErrorServiceException;

/**
 * 校验工具类
 *
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.15
 */
public class ValidUtils {

    /**
     * 客户端合法性校验
     *
     * @param terminal 客户端字符串
     * @throws ParamErrorServiceException
     */
    public static void validTerminal(String terminal) {
        switch (terminal) {
            case SsydtConsts.TerminalType.ANDROID:
            case SsydtConsts.TerminalType.IOS:
            case SsydtConsts.TerminalType.BROWSER:
                break;
            default:
                throw new ParamErrorServiceException("客户端类型错误");
        }
    }

    private ValidUtils() {
    }
}
